/*
 * CommandDispatcher.cpp
 *
 * Created: 11/19/2013 3:37:57 PM
 *  Author: brodzki
 */ 

#ifndef COMMAND_DISPATCHER_H_
#define COMMAND_DISPATCHER_H_

#include "DisplayHandler.h"
#include "ThermometerHandler.h"
#include "RelayHandler.h"

class CommandDispatcher
{
public:
	DisplayHandler		*display;
	RelayHandler		*relay;
	ThermometerHandler	*thermo;
	
	void dispatch(char command_num)
	{
		switch(command_num)
		{
		case '0':
			display->clear();
			display->write_text("enabling relay");
			relay->enable();
			break;
		case '1':
			display->clear();
			display->write_text("disabling relay");
			relay->disable();
			break;
		case '2':
			display->clear();
			thermo->start_measurement();
			char buf[10];
			thermo->get_result(buf);
			display->write_text(buf);
			break;
		}
	}
};

#endif